<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>判断闰年哈数</title>
    <script>
        //函数判断润年
        function isleapyear(year) {
            var flag = false;
            if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                flag = true;
            }
            return flag;
        }
        console.log(isleapyear(2020) ? '2020是闰年' : '2020不是闰年');
        console.log(isleapyear(2021) ? '2021是闰年' : '2021不是闰年');
        console.log(isleapyear(2024) ? '24是闰年' : '24不是闰年');


        //     var newArr = [];
        //     for (var i = arr.length - 1; i >= 0; i--) {
        //         newArr[newArr.length] = arr[i];
        //     }
        //     return newArr;
        // }
        // var arr1 = reverse([1, 3, 4, 6, 9]);
        // console.log(arr1);
    </script>
</head>

<body>

</body>

</html>